package com.flong.utils.thrift.impl;

import org.apache.thrift.TException;
import org.apache.thrift.TProcessor;
import org.springframework.stereotype.Service;

import com.flong.utils.thrift.PersonService;
import com.flong.utils.thrift.support.EnableThriftServer;
import com.flong.utils.thrift.support.ThriftServerService;

@Service
@EnableThriftServer(genClass = PersonService.class)
public class PersonServiceImpl implements PersonService.Iface, ThriftServerService {

	
	@Override
	public String getName() {
		/**
		 * 此方法返回值一定要写.#ThriftApplicationListener定义的协议标准有关系
		 */
		return "personService";
	}

	@Override
	public TProcessor getProcessor(ThriftServerService bean) {

		PersonService.Iface impl = (PersonService.Iface) bean;
		return new PersonService.Processor<PersonService.Iface>(impl);
	}

	@Override
	public String queryUserAll(String username) throws TException {
		return "hello," + username;
	}

}
